
#include "headers.h"
#include "database.h"

using namespace database;

#define MODELID_SOLIFUGE_ALTITUDE    172
#define MODELID_SOLIFUGE_SUBTERMINAL 173
#define MODELID_FALCO_WINGSUIT       362
#define MODELID_FB_SUIT              747

#define DESCRIPTION_SOLIFUGE_ALTITUDE    339
#define DESCRIPTION_SOLIFUGE_SUBTERMINAL 340
#define DESCRIPTION_FALCO_WINGSUIT       363
#define DESCRIPTION_FB_SUIT              748

#define COST_SOLIFUGE_ALTITUDE    200.0f
#define COST_SOLIFUGE_SUBTERMINAL 300.0f
#define COST_FALCO_WINGSUIT       1500.0f
#define COST_FB_SUIT              0.0f

#define PROPERTIES_SOLIFUGE_ALTITUDE    0.0625f, 1.0f, 1.0f,   1.0f, 1.0f,   1.0f,   1.0f,  1.0f, 0.125f
#define PROPERTIES_SOLIFUGE_SUBTERMINAL 0.125f,  1.0f, 1.0f,   1.5f, 1.125f, 1.125f, 1.25f, 1.25f, 0.125f
#define PROPERTIES_FALCO_WINGSUIT       0.25f,   1.0f, 1.125f, 4.0f, 1.0f,   1.66f,  1.5f,  1.5f, 0.25f
#define PROPERTIES_FB_SUIT              0.125f,  1.0f, 1.0f,   1.5f, 1.125f, 1.125f, 1.25f, 1.25f, 0.125f

static Suit suits[] = 
{
    /* 000 */ { true, COST_SOLIFUGE_ALTITUDE, false, 0, MODELID_SOLIFUGE_ALTITUDE, DESCRIPTION_SOLIFUGE_ALTITUDE, CLID_DARK_BLUE, MFRID_D3, 0, PROPERTIES_SOLIFUGE_ALTITUDE },
    /* 001 */ { true, COST_SOLIFUGE_ALTITUDE, false, 0, MODELID_SOLIFUGE_ALTITUDE, DESCRIPTION_SOLIFUGE_ALTITUDE, CLID_PURPLE, MFRID_D3, 1, PROPERTIES_SOLIFUGE_ALTITUDE },
    /* 002 */ { true, COST_SOLIFUGE_ALTITUDE, false, 0, MODELID_SOLIFUGE_ALTITUDE, DESCRIPTION_SOLIFUGE_ALTITUDE, CLID_KHAKI, MFRID_D3, 2, PROPERTIES_SOLIFUGE_ALTITUDE },
    /* 003 */ { true, COST_SOLIFUGE_ALTITUDE, false, 0, MODELID_SOLIFUGE_ALTITUDE, DESCRIPTION_SOLIFUGE_ALTITUDE, CLID_LILAC, MFRID_D3, 3, PROPERTIES_SOLIFUGE_ALTITUDE },
    /* 004 */ { true, COST_SOLIFUGE_ALTITUDE, false, 0, MODELID_SOLIFUGE_ALTITUDE, DESCRIPTION_SOLIFUGE_ALTITUDE, CLID_YELLOW, MFRID_D3, 4, PROPERTIES_SOLIFUGE_ALTITUDE },
    /* 005 */ { true, COST_SOLIFUGE_ALTITUDE, false, 0, MODELID_SOLIFUGE_ALTITUDE, DESCRIPTION_SOLIFUGE_ALTITUDE, CLID_MAGENTA, MFRID_D3, 5, PROPERTIES_SOLIFUGE_ALTITUDE },
    /* 006 */ { true, COST_SOLIFUGE_ALTITUDE, false, 0, MODELID_SOLIFUGE_ALTITUDE, DESCRIPTION_SOLIFUGE_ALTITUDE, CLID_LIGHT_BLUE, MFRID_D3, 6, PROPERTIES_SOLIFUGE_ALTITUDE },
    /* 007 */ { true, COST_SOLIFUGE_ALTITUDE, false, 0, MODELID_SOLIFUGE_ALTITUDE, DESCRIPTION_SOLIFUGE_ALTITUDE, CLID_LIGHT_GREEN, MFRID_D3, 7, PROPERTIES_SOLIFUGE_ALTITUDE },
    /* 008 */ { true, COST_SOLIFUGE_ALTITUDE, false, 0, MODELID_SOLIFUGE_ALTITUDE, DESCRIPTION_SOLIFUGE_ALTITUDE, CLID_ORANGE, MFRID_D3, 8, PROPERTIES_SOLIFUGE_ALTITUDE },
    /* 009 */ { true, COST_SOLIFUGE_ALTITUDE, false, 0, MODELID_SOLIFUGE_ALTITUDE, DESCRIPTION_SOLIFUGE_ALTITUDE, CLID_WHITE, MFRID_D3, 9, PROPERTIES_SOLIFUGE_ALTITUDE },
    /* 010 */ { true, COST_SOLIFUGE_SUBTERMINAL, false, 0, MODELID_SOLIFUGE_SUBTERMINAL, DESCRIPTION_SOLIFUGE_SUBTERMINAL, CLID_YELLOW, MFRID_D3, 10, PROPERTIES_SOLIFUGE_SUBTERMINAL },
    /* 011 */ { true, COST_SOLIFUGE_SUBTERMINAL, false, 0, MODELID_SOLIFUGE_SUBTERMINAL, DESCRIPTION_SOLIFUGE_SUBTERMINAL, CLID_CRIMSON, MFRID_D3, 11, PROPERTIES_SOLIFUGE_SUBTERMINAL },
    /* 012 */ { true, COST_SOLIFUGE_SUBTERMINAL, false, 0, MODELID_SOLIFUGE_SUBTERMINAL, DESCRIPTION_SOLIFUGE_SUBTERMINAL, CLID_LIGHT_VIOLET, MFRID_D3, 12, PROPERTIES_SOLIFUGE_SUBTERMINAL },
    /* 013 */ { true, COST_SOLIFUGE_SUBTERMINAL, false, 0, MODELID_SOLIFUGE_SUBTERMINAL, DESCRIPTION_SOLIFUGE_SUBTERMINAL, CLID_VIOLET, MFRID_D3, 13, PROPERTIES_SOLIFUGE_SUBTERMINAL },
    /* 014 */ { true, COST_SOLIFUGE_SUBTERMINAL, false, 0, MODELID_SOLIFUGE_SUBTERMINAL, DESCRIPTION_SOLIFUGE_SUBTERMINAL, CLID_DARK_BLUE, MFRID_D3, 14, PROPERTIES_SOLIFUGE_SUBTERMINAL },
    /* 015 */ { true, COST_SOLIFUGE_SUBTERMINAL, false, 0, MODELID_SOLIFUGE_SUBTERMINAL, DESCRIPTION_SOLIFUGE_SUBTERMINAL, CLID_DARK_GREEN, MFRID_D3, 15, PROPERTIES_SOLIFUGE_SUBTERMINAL },
    /* 016 */ { true, COST_SOLIFUGE_SUBTERMINAL, false, 0, MODELID_SOLIFUGE_SUBTERMINAL, DESCRIPTION_SOLIFUGE_SUBTERMINAL, CLID_WHITE, MFRID_D3, 16, PROPERTIES_SOLIFUGE_SUBTERMINAL },
    /* 017 */ { true, COST_FALCO_WINGSUIT, true, 1, MODELID_FALCO_WINGSUIT, DESCRIPTION_FALCO_WINGSUIT, CLID_CRIMSON, MFRID_D3, 17, PROPERTIES_FALCO_WINGSUIT },
    /* 018 */ { true, COST_FALCO_WINGSUIT, true, 1, MODELID_FALCO_WINGSUIT, DESCRIPTION_FALCO_WINGSUIT, CLID_LIGHT_VIOLET, MFRID_D3, 36, PROPERTIES_FALCO_WINGSUIT },
    /* 019 */ { true, COST_FALCO_WINGSUIT, true, 1, MODELID_FALCO_WINGSUIT, DESCRIPTION_FALCO_WINGSUIT, CLID_VIOLET, MFRID_D3, 37, PROPERTIES_FALCO_WINGSUIT },
    /* 020 */ { true, COST_FALCO_WINGSUIT, true, 1, MODELID_FALCO_WINGSUIT, DESCRIPTION_FALCO_WINGSUIT, CLID_DARK_BLUE, MFRID_D3, 38, PROPERTIES_FALCO_WINGSUIT },
    /* 021 */ { true, COST_FALCO_WINGSUIT, true, 1, MODELID_FALCO_WINGSUIT, DESCRIPTION_FALCO_WINGSUIT, CLID_LIGHT_BLUE, MFRID_D3, 39, PROPERTIES_FALCO_WINGSUIT },
    /* 022 */ { true, COST_FALCO_WINGSUIT, true, 1, MODELID_FALCO_WINGSUIT, DESCRIPTION_FALCO_WINGSUIT, CLID_LIGHT_GREEN, MFRID_D3, 40, PROPERTIES_FALCO_WINGSUIT },
    /* 023 */ { true, COST_FALCO_WINGSUIT, true, 1, MODELID_FALCO_WINGSUIT, DESCRIPTION_FALCO_WINGSUIT, CLID_DARK_GREEN, MFRID_D3, 41, PROPERTIES_FALCO_WINGSUIT },
    /* 024 */ { true, COST_FALCO_WINGSUIT, true, 1, MODELID_FALCO_WINGSUIT, DESCRIPTION_FALCO_WINGSUIT, CLID_YELLOW, MFRID_D3, 42, PROPERTIES_FALCO_WINGSUIT },
    /* 025 */ { true, COST_FALCO_WINGSUIT, true, 1, MODELID_FALCO_WINGSUIT, DESCRIPTION_FALCO_WINGSUIT, CLID_ORANGE, MFRID_D3, 43, PROPERTIES_FALCO_WINGSUIT },
    /* 026 */ { true, COST_FALCO_WINGSUIT, true, 1, MODELID_FALCO_WINGSUIT, DESCRIPTION_FALCO_WINGSUIT, CLID_WHITE, MFRID_D3, 44, PROPERTIES_FALCO_WINGSUIT },
    /* 027 */ { true, COST_SOLIFUGE_SUBTERMINAL, false, 0, MODELID_SOLIFUGE_SUBTERMINAL, DESCRIPTION_SOLIFUGE_SUBTERMINAL, CLID_BLACK, MFRID_D3, 64, PROPERTIES_SOLIFUGE_SUBTERMINAL },
    /* 028 */ { false, 0.0f, false, 0, MODELID_FB_SUIT, DESCRIPTION_FB_SUIT, CLID_WHITE, MFRID_D3, 70, PROPERTIES_FB_SUIT },
    { 0.0f, 0,0,0,0 }
};

unsigned int Suit::getNumRecords(void)
{
    unsigned int result = 0;
    unsigned int i = 0;
    while( suits[i].nameId != 0 ) i++, result++;
    return result;
}

Suit* Suit::getRecord(unsigned int id)
{
    assert( id >= 0 && id < getNumRecords() );
    return suits + id;
}